﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace JumpFleetGameLib.UI
{
   public class HUD
    {
       SpriteFont m_Font;
       int m_nPlayerHealth;
       int m_nAssultShipHealth;
       int m_nMinerHealth;
       int m_nHealerHealth;
       int m_nResources;
       bool[] m_bisFTLReady;
       float m_fSecondsPlayed;
       public int PlayerHealth { get { return m_nPlayerHealth; } set { m_nPlayerHealth = value; } }

       public HUD()
       {
           m_nPlayerHealth = 100;
           m_nAssultShipHealth = 100;
           m_nMinerHealth = 100;
           m_nHealerHealth = 100;
           m_nResources = 0;
           m_bisFTLReady = new bool[4];
            m_bisFTLReady[0] = true;
            m_bisFTLReady[1] = true;
            m_bisFTLReady[2] = true;
            m_bisFTLReady[3] = true;
       }

       public void UpdateHUD(GameTime gametime)
       {
           m_fSecondsPlayed += (float)gametime.ElapsedGameTime.TotalSeconds;
       }

       public HUD( ContentManager content) : base()
       {
           m_Font = content.Load<SpriteFont>("Fonts\\mainMenuFont");
           m_nPlayerHealth = 100;
           m_nAssultShipHealth = 100;
           m_nMinerHealth = 100;
           m_nHealerHealth = 100;
           m_nResources = 0;
           m_bisFTLReady = new bool[4];
           m_bisFTLReady[0] = true;
           m_bisFTLReady[1] = true;
           m_bisFTLReady[2] = true;
           m_bisFTLReady[3] = true;
       }



       public void DrawHUD(SpriteBatch batch)
       {
           batch.DrawString(m_Font,"Resources: " + m_nResources.ToString() + " /100",Vector2.Zero,Color.White);
           batch.DrawString(m_Font,"Time Played: " + m_fSecondsPlayed.ToString(),new Vector2(1024*0.5f,0),Color.White);

           batch.DrawString(m_Font, "Base Ship: " + m_nPlayerHealth.ToString() + " /100", new Vector2(0, 680), Color.Orange);
           batch.DrawString(m_Font, "Assult Ship: " + m_nAssultShipHealth.ToString() + " /100", new Vector2(280, 680), Color.Red);
           batch.DrawString(m_Font, "Mining Ship: " + m_nMinerHealth.ToString() + " /100", new Vector2(580, 680), Color.Blue);
           batch.DrawString(m_Font, "Repair Ship: " + m_nHealerHealth.ToString() + " /100", new Vector2(880, 680), Color.Green);
           
       }
    }
}
